<template>
<div>
  <div>
    <van-nav-bar title="景区列表" left-text="返回" left-arrow @click-left="back()">
      <template #right>
        <router-link to='/search'>
        <van-icon name="search" size="22" />
        </router-link>
      </template>
    </van-nav-bar>
  </div>
  <div>
    <div class="dv1" v-for="a in attdtos">
      <van-row>
        <van-col :span="12">
          <img class="img1" :src="a.imgurl">
        </van-col>
        <van-col :span="12">
          <h4 class="dv2">{{ a.name }} 跟团价：{{ a.price }}</h4>
          <div class="dv2">{{ a.label }}</div>
          <div class="dv2">所在城市：{{ a.city }}</div>
          <div class="dv2">
            <div>
              <van-button class="btn1" type="danger" @click="look(a.id)">查看详情</van-button>
            </div>
          </div>
        </van-col>
      </van-row>
    </div>
  </div>
</div>
</template>

<script>
export default {
  name: "AttDtoView",
  data(){
    return{

      attdtos:[

      ],
      name:{
        id:"",
      },


    }
  },
  mounted() {
    this.axios.get("/api/attdto/lookName.do").then(r=>{
      if(r.data.code==200){
        this.attdtos=r.data.data;
        this.name.id=r.data.data.id;
      }
    })

  },

  methods:{
    back(){
      this.$router.push("/index");
    },
    look(id){
      // this.axios.get("api/attdto/selectById.do?id="+this.id).then((r)=>{
      //   if(r.data.code==200){
      //     this.$router.push("/att");
      //     this.$router.push({path:"/att",query:{id:this.id}});
      //   }
      // })
      this.$router.push({path:"/att",query:{id:id}});
    }

  }
}
</script>

<style scoped>
.dv1{
  width: 90%;
  margin-left: 5%;
  margin-bottom: 10px;
}
.dv2{
  margin: 5px;
  font-size: 13px;
}
.btn1{
  width: 60%;
  height: 20%;
  margin-left: 10%;
  margin-top: 5%;
  border-radius: 20px;
  margin-bottom: 2px;
}
.img1{
  width: 150px;
  height: 100px;
}

</style>